POV-Ray : Newsgroups : povray.general : Mathematics help needed, please. : Re: Mathematics help needed, please. Server Time
12 Aug 2024 13:18:54 EDT (-0400)
  Re: Mathematics help needed, please.  
From: Andrew Cocker
Date: 11 Feb 1999 13:47:49
Message: <36c325d5.0@news.povray.org>
Obviously  I don't really understand the use of macros.. can you point out what else I
need to put to complete this please.

#macro BeadPos( Start, End, NumBeads, BeadNum )
    Start+(BeadNum-1)*(End - Start)/(NumBeads-1)
#end

#declare Start=<-1,1,0>;
#declare End=<1,-1,0>;
#declare NumBeads=25;
#declare BeadNum=1;
#while (BeadNum<=NumBeads)
  sphere { BeadPos  texture {Reddy} }
#declare BeadNum=BeadNum+1;
#end

Thanks

Andy

Ron Parker wrote in message <36c31b51.0@news.povray.org>...
>On Thu, 11 Feb 1999 15:10:37 -0000, Andrew Cocker wrote:
>>Okay, here's my problem. I'm working on an anim.
>>Let's say I have two points in space. Joining these, I have a thin piece of elastic
( or
>>similar stretchable material ). Threaded on this elastic are a number (
provisionally
5 )
>>of spheres, spaced evenly.
>>As the two points move around, how do I get the vector of each sphere as they remain
>>evenly spaced along the elastic?
>>I need the vector as each sphere will eventually become a blob component.
>
>This is untested, but it should be close to what you want.
>
>// This macro returns the center of a bead as requested
>// inputs: Start    = position of start of strand (vector)
>//         End      = position of end of strand (vector)
>//         NumBeads = number of beads on strand (integer >= 2)
>//         BeadNum  = Bead number (integer, 1 .. NumBeads)
>
>#macro BeadPos( Start, End, NumBeads, BeadNum )
>    Start+(BeadNum-1)*(End - Start)/(NumBeads-1)
>#end
>


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.